<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>

<html>
<head>
<script type="text/javascript" >



</script>

<script type="text/javascript">
var aclsStatusJson;  
$(document).ready(function () {         
	
})


/**
 * 保存页面数据
 */
 function savealcs() {
	//判断车辆编号是否为空vehicleNo
	 var topicVal=$("#topic").val();
	 if(topicVal==null||topicVal==""){
			var spans= document.getElementById("massage")
			spans.style="display:inline-block;color:red"
			return;
		}
    //将数据保存到数据库中
    

    $.ajax({
    	 url: "acls/save.do?username=${username}",
    	 type:'post',
    	 data: $("#vehicle-fm").serialize(),
    	 success:function (data){
    		 
      		 //返回到默认选中展示目录
      		 parent.showCenter('vehicle/power.do?username=${username}');
      		 
      		//'http://'+host+'/vehicleApi/addPhoto'
      	}

    	 });
} 
/**
 * 返回页面
 */
function back(url){
	$.get(url, {}, function(data){
		$("#center").empty();
        $("#center").html(data);
        $.parser.parse($("#center"));
    });
}
	
   /*  $('#vehicle-fm').form('submit', {
        url: 'rest/vehicle/save.do',        
        
        success: function (result) {
        	$.messager.progress('close'); 
            var result = eval('(' + result + ')');
            if (result.retCode=='0000') {
            	back('vehicle/index.do');
                
            } else {
                $.messager.show({
                    title: 'Error',
                    msg: result.retMsg
                });
            }
        }
    }); */

</script>
</head>
<body>
		
<div class="linkbar"><a> 车辆管理</a>/<a> 操作权限</a>/<a> 增加权限</a></div>
		<div id="vehicle-add" 	buttons="#vehicle-add-buttons">
			<form id="vehicle-fm" method="post" novalidate enctype="multipart/form-data">
			
			<div class="fitem">
				<label>账号:</label> ${username }
			</div>
			<div class="fitem">
				<label>主题权限:</label> <input name="topic" id="topic"
					class="easyui-validatebox" missingMessage="该输入项不能为空！"
					required="true" />
			   <span style="display:none" id="massage">请输入主题权限!!!</span>
			</div>
			<div class="fitem">
				<label>读写状态:</label> 
    				<select id="rw" class="easyui-combobox" name="rw" style="width:200px;" data-options="editable:false">   
   					
    				<option value="1">读</option>   
    				<option value="2">写</option>
</select>  
    				
			</div>
			
		</form>
		</div>
		<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" 	onclick="savealcs()">保存</a> 
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="back('vehicle/power.do?username=${username}')">返回</a>
		</div>
		

</body>
</html>
</html>